/**
 * 输入图的边
*/
#include "MGraph.c"

#ifndef MGRAPH_INPUT
#define MGRAPH_INPUT

// 从标准输入读取边信息，顶点下标从0开始
void readEdgeV0(MGraph* g, int edgeNum) {
    for (int i=0; i<edgeNum; i++) {
        int v1, v2;
        scanf("%d %d", &v1, &v2);
        insertEdge(g, v1, v2, 1);
    }
    g->edgeNum = edgeNum;
}

void readEdgeV0WithWeight(MGraph* g, int edgeNum) {
    for (int i=0; i<edgeNum; i++) {
        int v1, v2;
        WeightType dist;
        scanf("%d %d %d", &v1, &v2, &dist);
        insertEdge(g, v1, v2, dist);
    }
    g->edgeNum = edgeNum;
}

// 从标准输入读取边信息，顶点下标从1开始编号
void readEdgeV1(MGraph* g, int edgeNum) {
    for (int i=0; i<edgeNum; i++) {
        int v1, v2;
        scanf("%d %d", &v1, &v2);
        insertEdge(g, --v1, --v2, 1);
    }
    g->edgeNum = edgeNum;
}

void readEdgeV1WithWeight(MGraph* g, int edgeNum) {
    for (int i=0; i<edgeNum; i++) {
        int v1, v2;
        WeightType dist;
        scanf("%d %d %d", &v1, &v2, &dist);
        insertEdge(g, --v1, --v2, dist);
    }
    g->edgeNum = edgeNum;
}

#endif
